// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  compatibilityDate: "2024-11-01",
  devtools: { enabled: true },
  devServer: {
    port: 3000,
    host: "0.0.0.0",
  },

  app: {
    head: {
      title: "浦栎飞鑫",
      meta: [
        {
          name: "description",
          content: "Nuxt3",
        },
      ],
      script: [],
    },
  },

  typescript: {
    tsConfig: {
      compilerOptions: {
        typeRoots: ["./node_modules/@types/", "./types"],
      },
    },
  },

  runtimeConfig: {
    // 仅服务器端可用
    apiSecret: "123",
    // 客户端也可使用
    public: {
      apiBase: "https://api.jihw.top/web-api",
    },
  },

  modules: ["@element-plus/nuxt", "@nuxt/icon", "@nuxtjs/tailwindcss"],

  elementPlus: {
    /** Options */
    importStyle: "scss",
  },

  tailwindcss: {
    config: {
      theme: {
        extend: {
          colors: {
            primary: "#0b5ce7",
          },
        },
      },
    },
  },

  css: ["~/assets/styles/index.scss"], // 全局样式

  vite: {
    css: {
      preprocessorOptions: {
        scss: {
          additionalData: `@use "~/assets/styles/element/index.scss" as *;`,
        },
      },
    },
  },
});
